package org.acy.train.gateway;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.core.env.ConfigurableEnvironment;

/**
 * 网关启动类
 *
 * @author yust
 */
@SpringBootApplication
@Slf4j
@ComponentScan(basePackages = "org.acy.train")
public class GatewayApplication {

    public static void main(String[] args) {
        ConfigurableApplicationContext applicationContext = SpringApplication.run(GatewayApplication.class, args);
        ConfigurableEnvironment environment = applicationContext.getEnvironment();
        log.info("启动成功!!");
        log.info("网关地址: http://127.0.0.1:{}", environment.getProperty("server.port"));
    }

}
